package com.sdhs.basicinfo.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.sdhs.common.annotation.Log;
import com.sdhs.common.core.controller.BaseController;
import com.sdhs.common.core.domain.AjaxResult;
import com.sdhs.common.enums.BusinessType;
import com.sdhs.basicinfo.domain.GcFoundationConfigurationReminder;
import com.sdhs.basicinfo.service.IGcFoundationConfigurationReminderService;
import com.sdhs.common.utils.poi.ExcelUtil;
import com.sdhs.common.core.page.TableDataInfo;

/**
 * 基础信息管理-提醒配置Controller
 *
 * @author add
 * @date 2025-04-04
 */
@RestController
@RequestMapping("/basicinfo/reminder")
public class GcFoundationConfigurationReminderController extends BaseController
{
    @Autowired
    private IGcFoundationConfigurationReminderService gcFoundationConfigurationReminderService;

    /**
     * 查询基础信息管理-提醒配置列表
     */
    @PreAuthorize("@ss.hasPermi('basicinfo:reminder:list')")
    @GetMapping("/list")
    public TableDataInfo list(GcFoundationConfigurationReminder gcFoundationConfigurationReminder)
    {
        startPage();
        List<GcFoundationConfigurationReminder> list = gcFoundationConfigurationReminderService.selectGcFoundationConfigurationReminderList(gcFoundationConfigurationReminder);
        return getDataTable(list);
    }

    /**
     * 导出基础信息管理-提醒配置列表
     */
    @PreAuthorize("@ss.hasPermi('basicinfo:reminder:export')")
    @Log(title = "基础信息管理-提醒配置", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, GcFoundationConfigurationReminder gcFoundationConfigurationReminder)
    {
        List<GcFoundationConfigurationReminder> list = gcFoundationConfigurationReminderService.selectGcFoundationConfigurationReminderList(gcFoundationConfigurationReminder);
        ExcelUtil<GcFoundationConfigurationReminder> util = new ExcelUtil<GcFoundationConfigurationReminder>(GcFoundationConfigurationReminder.class);
        util.exportExcel(response, list, "基础信息管理-提醒配置数据");
    }

    /**
     * 获取基础信息管理-提醒配置详细信息
     */
    @PreAuthorize("@ss.hasPermi('basicinfo:reminder:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(gcFoundationConfigurationReminderService.selectGcFoundationConfigurationReminderById(id));
    }

    /**
     * 新增基础信息管理-提醒配置
     */
    @PreAuthorize("@ss.hasPermi('basicinfo:reminder:add')")
    @Log(title = "基础信息管理-提醒配置", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody GcFoundationConfigurationReminder gcFoundationConfigurationReminder)
    {
        return toAjax(gcFoundationConfigurationReminderService.insertGcFoundationConfigurationReminder(gcFoundationConfigurationReminder));
    }

    /**
     * 修改基础信息管理-提醒配置
     */
    @PreAuthorize("@ss.hasPermi('basicinfo:reminder:edit')")
    @Log(title = "基础信息管理-提醒配置", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody GcFoundationConfigurationReminder gcFoundationConfigurationReminder)
    {
        return toAjax(gcFoundationConfigurationReminderService.updateGcFoundationConfigurationReminder(gcFoundationConfigurationReminder));
    }

    /**
     * 删除基础信息管理-提醒配置
     */
    @PreAuthorize("@ss.hasPermi('basicinfo:reminder:remove')")
    @Log(title = "基础信息管理-提醒配置", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(gcFoundationConfigurationReminderService.deleteGcFoundationConfigurationReminderByIds(ids));
    }
}
